package com.eastfair.questionnaire.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 答题结果
 * </p>
 *
 * @author yuwx
 * @since 2021-09-04
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("q_answer_result")
@ApiModel(value = "AnswerResult", description = "答题结果")
@AllArgsConstructor
public class AnswerResult extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    @ApiModelProperty(value = "")
    @TableField(value = "exhibition_id")
    @Excel(name = "")
    private Long exhibitionId;

    /**
     * 问题id
     */
    @ApiModelProperty(value = "问题id")
    @TableField(value = "question_id")
    @Excel(name = "问题id")
    private Long questionId;

    /**
     * 答案id
     */
    @ApiModelProperty(value = "答案id")
    @TableField(value = "answer_id")
    @Excel(name = "答案id")
    private Long answerId;

    /**
     * 填空题输入结果
     */
    @ApiModelProperty(value = "填空题输入结果")
    @Size(max = 128, message = "填空题输入结果长度不能超过128")
    @TableField(value = "input_result", condition = LIKE)
    @Excel(name = "填空题输入结果")
    private String inputResult;

    /**
     * 实体类型
     */
    @ApiModelProperty(value = "实体类型")
    @Size(max = 32, message = "实体类型长度不能超过32")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "实体类型")
    private String subjectType;

    /**
     * 实体id
     */
    @ApiModelProperty(value = "实体id")
    @TableField(value = "subject_id")
    @Excel(name = "实体id")
    private Long subjectId;

    /**
     * 答案版本(问题修改时间戳)
     */
    @ApiModelProperty(value = "答案版本(问题修改时间戳)")
    @TableField(value = "version_num")
    @Excel(name = "答案版本(问题修改时间戳)")
    private Integer versionNum;

    /**
     * 数据来源系统
     */
    @ApiModelProperty(value = "数据来源系统")
    @Size(max = 64, message = "数据来源系统长度不能超过64")
    @TableField(value = "source_system", condition = LIKE)
    @Excel(name = "数据来源系统")
    private String sourceSystem;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enable")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;

    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    @TableField(value = "is_delete")
    @Excel(name = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDelete;


    @Builder
    public AnswerResult(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, Long questionId, Long answerId, String inputResult, 
                    String subjectType, Long subjectId, Integer versionNum, String sourceSystem, Integer isEnable, Integer isDelete) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.questionId = questionId;
        this.answerId = answerId;
        this.inputResult = inputResult;
        this.subjectType = subjectType;
        this.subjectId = subjectId;
        this.versionNum = versionNum;
        this.sourceSystem = sourceSystem;
        this.isEnable = isEnable;
        this.isDelete = isDelete;
    }

}
